.class public Lcom/netease/newsreader/activity/SelectColumn;
.super Lcom/netease/newsreader/activity/BaseActivity;
.source "SelectColumn.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/activity/SelectColumn$CheckBoxItem;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/netease/newsreader/activity/BaseActivity;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# static fields
.field public static final CHECKBOX:Ljava/lang/String; = "checkbox"

.field public static final CHECKBOX_STATUS:Ljava/lang/String; = "checkbox_status"

.field public static final ITEM_INDEX:Ljava/lang/String; = "item_index"


# instance fields
.field private adapter:Lcom/netease/newsreader/util/MergeAdapter;

.field private appdata:Lcom/netease/newsreader/activity/MyApplication;

.field private categoriesData:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private checkboxListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;

.field private columnsData:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private columnsList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private handler:Landroid/os/Handler;

.field private mProgressbarLoadingLayout:Landroid/widget/LinearLayout;

.field private saveButton:Landroid/widget/Button;

.field private saveClickListener:Landroid/view/View$OnClickListener;

.field private searchBox:Landroid/widget/EditText;

.field private selectList:Landroid/widget/ListView;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 29
    invoke-direct {p0}, Lcom/netease/newsreader/activity/BaseActivity;-><init>()V

    .line 38
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsData:Ljava/util/ArrayList;

    .line 39
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->categoriesData:Ljava/util/ArrayList;

    .line 40
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsList:Ljava/util/ArrayList;

    .line 107
    new-instance v0, Lcom/netease/newsreader/activity/SelectColumn$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/activity/SelectColumn$1;-><init>(Lcom/netease/newsreader/activity/SelectColumn;)V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->handler:Landroid/os/Handler;

    .line 221
    new-instance v0, Lcom/netease/newsreader/activity/SelectColumn$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/activity/SelectColumn$2;-><init>(Lcom/netease/newsreader/activity/SelectColumn;)V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->checkboxListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;

    .line 244
    new-instance v0, Lcom/netease/newsreader/activity/SelectColumn$3;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/activity/SelectColumn$3;-><init>(Lcom/netease/newsreader/activity/SelectColumn;)V

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->saveClickListener:Landroid/view/View$OnClickListener;

    .line 29
    return-void
.end method

.method private UpdateDisplay()V
    .locals 5

    .prologue
    .line 71
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsList:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->clear()V

    .line 72
    const-string v3, "more_columns"

    iget-object v4, p0, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {p0, v3, v4}, Lcom/netease/newsreader/util/Tools;->getDataFromDB(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase;)Landroid/database/Cursor;

    move-result-object v0

    .line 73
    .local v0, cursor:Landroid/database/Cursor;
    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->startManagingCursor(Landroid/database/Cursor;)V

    .line 74
    if-eqz v0, :cond_0

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v3

    if-eqz v3, :cond_0

    .line 76
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_0
    invoke-interface {v0}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 83
    :cond_0
    const-string v3, "top_columns"

    iget-object v4, p0, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {p0, v3, v4}, Lcom/netease/newsreader/util/Tools;->getDataFromDB(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase;)Landroid/database/Cursor;

    move-result-object v1

    .line 84
    .local v1, cursor2:Landroid/database/Cursor;
    invoke-virtual {p0, v1}, Lcom/netease/newsreader/activity/SelectColumn;->startManagingCursor(Landroid/database/Cursor;)V

    .line 85
    if-eqz v1, :cond_1

    invoke-interface {v1}, Landroid/database/Cursor;->getCount()I

    move-result v3

    if-eqz v3, :cond_1

    .line 87
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_1
    invoke-interface {v1}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v3

    if-eqz v3, :cond_3

    .line 94
    :cond_1
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->mProgressbarLoadingLayout:Landroid/widget/LinearLayout;

    const/4 v4, 0x0

    invoke-virtual {v3, v4}, Landroid/widget/LinearLayout;->setVisibility(I)V

    .line 95
    new-instance v3, Lcom/netease/newsreader/util/MergeAdapter;

    invoke-direct {v3}, Lcom/netease/newsreader/util/MergeAdapter;-><init>()V

    iput-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->adapter:Lcom/netease/newsreader/util/MergeAdapter;

    .line 97
    new-instance v3, Lcom/netease/newsreader/activity/SelectColumn$4;

    invoke-direct {v3, p0}, Lcom/netease/newsreader/activity/SelectColumn$4;-><init>(Lcom/netease/newsreader/activity/SelectColumn;)V

    .line 103
    invoke-virtual {v3}, Lcom/netease/newsreader/activity/SelectColumn$4;->start()V

    .line 105
    return-void

    .line 78
    .end local v1           #cursor2:Landroid/database/Cursor;
    :cond_2
    const-string v3, "tname"

    invoke-interface {v0, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v2

    .line 79
    .local v2, i:I
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsList:Ljava/util/ArrayList;

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 76
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_0

    .line 89
    .end local v2           #i:I
    .restart local v1       #cursor2:Landroid/database/Cursor;
    :cond_3
    const-string v3, "tname"

    invoke-interface {v1, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v2

    .line 90
    .restart local v2       #i:I
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsList:Ljava/util/ArrayList;

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 87
    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_1
.end method

.method static synthetic access$0(Lcom/netease/newsreader/activity/SelectColumn;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 39
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->categoriesData:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/activity/SelectColumn;)Lcom/netease/newsreader/util/MergeAdapter;
    .locals 1
    .parameter

    .prologue
    .line 41
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->adapter:Lcom/netease/newsreader/util/MergeAdapter;

    return-object v0
.end method

.method static synthetic access$2(Lcom/netease/newsreader/activity/SelectColumn;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsData:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$3(Lcom/netease/newsreader/activity/SelectColumn;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 40
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsList:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/widget/LinearLayout;
    .locals 1
    .parameter

    .prologue
    .line 34
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->mProgressbarLoadingLayout:Landroid/widget/LinearLayout;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/widget/ListView;
    .locals 1
    .parameter

    .prologue
    .line 31
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->selectList:Landroid/widget/ListView;

    return-object v0
.end method

.method static synthetic access$6(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/widget/CompoundButton$OnCheckedChangeListener;
    .locals 1
    .parameter

    .prologue
    .line 221
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->checkboxListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;

    return-object v0
.end method

.method static synthetic access$7(Lcom/netease/newsreader/activity/SelectColumn;Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 39
    iput-object p1, p0, Lcom/netease/newsreader/activity/SelectColumn;->categoriesData:Ljava/util/ArrayList;

    return-void
.end method

.method static synthetic access$8(Lcom/netease/newsreader/activity/SelectColumn;Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 38
    iput-object p1, p0, Lcom/netease/newsreader/activity/SelectColumn;->columnsData:Ljava/util/ArrayList;

    return-void
.end method

.method static synthetic access$9(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 107
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->handler:Landroid/os/Handler;

    return-object v0
.end method

.method private findViewById()V
    .locals 1

    .prologue
    .line 61
    const v0, 0x7f0c0136

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->selectList:Landroid/widget/ListView;

    .line 62
    const v0, 0x7f0c0134

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->saveButton:Landroid/widget/Button;

    .line 63
    const v0, 0x7f0c0135

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->searchBox:Landroid/widget/EditText;

    .line 65
    const v0, 0x7f0c00ce

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->mProgressbarLoadingLayout:Landroid/widget/LinearLayout;

    .line 66
    return-void
.end method

.method private setListeners()V
    .locals 2

    .prologue
    .line 217
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->saveButton:Landroid/widget/Button;

    iget-object v1, p0, Lcom/netease/newsreader/activity/SelectColumn;->saveClickListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 218
    iget-object v0, p0, Lcom/netease/newsreader/activity/SelectColumn;->selectList:Landroid/widget/ListView;

    invoke-virtual {v0, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 219
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    .parameter "savedInstanceState"

    .prologue
    .line 50
    invoke-super {p0, p1}, Lcom/netease/newsreader/activity/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 51
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->requestWindowFeature(I)Z

    .line 52
    const v0, 0x7f030056

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/activity/SelectColumn;->setContentView(I)V

    .line 54
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectColumn;->findViewById()V

    .line 55
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectColumn;->UpdateDisplay()V

    .line 56
    invoke-direct {p0}, Lcom/netease/newsreader/activity/SelectColumn;->setListeners()V

    .line 58
    return-void
.end method

.method protected onDestroy()V
    .locals 0

    .prologue
    .line 313
    invoke-super {p0}, Lcom/netease/newsreader/activity/BaseActivity;->onDestroy()V

    .line 315
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 6
    .parameter
    .parameter "arg1"
    .parameter "arg2"
    .parameter "arg3"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 292
    .local p1, arg0:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    new-instance v2, Landroid/content/Intent;

    const-class v3, Lcom/netease/newsreader/activity/ShowColumnInMore;

    invoke-direct {v2, p0, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 294
    .local v2, itemintent:Landroid/content/Intent;
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 296
    .local v0, b:Landroid/os/Bundle;
    :try_start_0
    const-string v4, "tid"

    .line 297
    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->adapter:Lcom/netease/newsreader/util/MergeAdapter;

    invoke-virtual {v3, p3}, Lcom/netease/newsreader/util/MergeAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/HashMap;

    const-string v5, "tid"

    invoke-virtual {v3, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    .line 296
    invoke-virtual {v0, v4, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 298
    const-string v4, "tname"

    iget-object v3, p0, Lcom/netease/newsreader/activity/SelectColumn;->adapter:Lcom/netease/newsreader/util/MergeAdapter;

    invoke-virtual {v3, p3}, Lcom/netease/newsreader/util/MergeAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/HashMap;

    const-string v5, "tname"

    invoke-virtual {v3, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v4, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 304
    :goto_0
    invoke-virtual {v2, v0}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    .line 306
    invoke-virtual {p0, v2}, Lcom/netease/newsreader/activity/SelectColumn;->startActivity(Landroid/content/Intent;)V

    .line 307
    return-void

    .line 299
    :catch_0
    move-exception v1

    .line 301
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method
